<?php


//if(file_exists('ela.wsdl')){
//    include("__DIR__ . '/../application/index/controller/Modulestock2.php");
//    $objSoapServer = new \SoapServer("ela.wsdl");//ThirdOrder.wsdl是刚创建的wsdl文件
//    $objSoapServer->setClass("Modulestock2");//注册ThirdOrder类的所有方法
//    $objSoapServer->handle();//处理请求
//}else{
//    include("SoapDiscovery.class.php");
//    //\app\index\controller\Modulestock2
//    $disc = new SoapDiscovery('Modulestock2', 'ela');
//    $res = $disc->getWSDL();
//    file_put_contents("ela.wsdl", $res);
//}

if (file_exists('ThirdOrder.wsdl')) {
    include("ThirdOrder.php");
    $objSoapServer = new \SoapServer("ThirdOrder.wsdl");//ThirdOrder.wsdl是刚创建的wsdl文件
    $objSoapServer->setClass("ThirdOrder");//注册ThirdOrder类的所有方法
    $objSoapServer->handle();//处理请求
} else {
    include("ThirdOrder.php");
    include("SoapDiscovery.class.php");
    $disc = new SoapDiscovery('ThirdOrder', 'ThirdOrder');//api类文件名，service接口目录
    $res = $disc->getWSDL();
    file_put_contents("ThirdOrder.wsdl", $res);
}